package com.hngates.architecture.service.impl;

import java.util.List;

import com.hngates.architecture.domain.vo.ArcBuilderCompanyVO;
import com.hngates.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hngates.architecture.mapper.ArcBuilderCompanyMapper;
import com.hngates.architecture.domain.ArcBuilderCompany;
import com.hngates.architecture.service.IArcBuilderCompanyService;
import com.hngates.common.core.text.Convert;

/**
 * 建设单位Service业务层处理
 * 
 * @author jwhe
 * @date 2022-07-04
 */
@Service
public class ArcBuilderCompanyServiceImpl implements IArcBuilderCompanyService 
{
    @Autowired
    private ArcBuilderCompanyMapper arcBuilderCompanyMapper;

    /**
     * 查询建设单位
     * 
     * @param id 建设单位主键
     * @return 建设单位
     */
    @Override
    public ArcBuilderCompany selectArcBuilderCompanyById(Long id)
    {
        return arcBuilderCompanyMapper.selectArcBuilderCompanyById(id);
    }

    /**
     * 查询建设单位列表
     * 
     * @param arcBuilderCompany 建设单位
     * @return 建设单位
     */
    @Override
    public List<ArcBuilderCompany> selectArcBuilderCompanyList(ArcBuilderCompany arcBuilderCompany)
    {
        return arcBuilderCompanyMapper.selectArcBuilderCompanyList(arcBuilderCompany);
    }

    /**
     * 新增建设单位
     * 
     * @param arcBuilderCompany 建设单位
     * @return 结果
     */
    @Override
    public int insertArcBuilderCompany(ArcBuilderCompany arcBuilderCompany)
    {
        arcBuilderCompany.setCreateTime(DateUtils.getNowDate());
        return arcBuilderCompanyMapper.insertArcBuilderCompany(arcBuilderCompany);
    }

    /**
     * 修改建设单位
     * 
     * @param arcBuilderCompany 建设单位
     * @return 结果
     */
    @Override
    public int updateArcBuilderCompany(ArcBuilderCompany arcBuilderCompany)
    {
        arcBuilderCompany.setUpdateTime(DateUtils.getNowDate());
        return arcBuilderCompanyMapper.updateArcBuilderCompany(arcBuilderCompany);
    }

    /**
     * 批量删除建设单位
     * 
     * @param ids 需要删除的建设单位主键
     * @return 结果
     */
    @Override
    public int deleteArcBuilderCompanyByIds(String ids)
    {
        return arcBuilderCompanyMapper.deleteArcBuilderCompanyByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除建设单位信息
     * 
     * @param id 建设单位主键
     * @return 结果
     */
    @Override
    public int deleteArcBuilderCompanyById(Long id)
    {
        return arcBuilderCompanyMapper.deleteArcBuilderCompanyById(id);
    }

    @Override
    public ArcBuilderCompany selectArcBuilderCompanyByName(String companyName) {
        return arcBuilderCompanyMapper.selectArcBuilderCompanyByName(companyName);
    }

    @Override
    public List<ArcBuilderCompanyVO> selectArcBuilderCompanyVOList(ArcBuilderCompany arcBuilderCompany) {
        return arcBuilderCompanyMapper.selectArcBuilderCompanyVOList(arcBuilderCompany);
    }
}
